namespace EyeOpen.Warehouse.Mvc.TestMvc.Tests.Controllers
{
	using System;
	using System.Collections;
	using System.Collections.Generic;
	using System.Linq;
	using System.Linq.Expressions;

	using Data;

	internal class Repository<T> : IRepository<T>
	{
		private readonly List<T> temp = new List<T>();

		public Expression Expression
		{
			get
			{
				return temp.AsQueryable().Expression;
			}
		}

		public Type ElementType
		{
			get
			{
				return temp.AsQueryable().ElementType;
			}
		}

		public IQueryProvider Provider
		{
			get
			{
				return temp.AsQueryable().Provider;
			}
		}

		public void Add(T item)
		{
			temp.Add(item);
		}

		public void Remove(T item)
		{
			temp.Remove(item);
		}

		public IEnumerator<T> GetEnumerator()
		{
			return temp.GetEnumerator();
		}

		IEnumerator IEnumerable.GetEnumerator()
		{
			return GetEnumerator();
		}
	}
}